package com.goldmantis.alitrip.service;

import com.goldmantis.alitrip.common.BaseService;
import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlitripBtripFlightCitySuggestRequest;
import com.taobao.api.response.AlitripBtripFlightCitySuggestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author:Shmily
 * @Description:
 * @Date:Create in 16:32 2018/1/15
 */
@Service
public class FlightCityService extends BaseService {

    @Autowired
    private  TaobaoClient client;

    public AlitripBtripFlightCitySuggestResponse getFlightCitySuggest(String cityName,String userId) throws Exception {
        AlitripBtripFlightCitySuggestRequest req = new AlitripBtripFlightCitySuggestRequest();
        req.setUserId(userId);
        req.setKeyword(cityName);
        req.setCorpId(corp_id);
        AlitripBtripFlightCitySuggestResponse rsp = client.execute(req, accessToken);
        return rsp;
    }
}
